﻿using System;

class Solution
{
    static int gcd(int m, int n)
    {
        while (n != 0)
        {
            int temp = m % n;
            m = n;
            n = temp;
        }
        return m;
    }

    static int lcm(int m, int n)
    {
        return m * n / gcd(m, n);
    }

    static void Main(string[] args)
    {
        Console.Write("请输入两个正整数：");
        int m = int.Parse(Console.ReadLine());
        int n = int.Parse(Console.ReadLine());

        Console.WriteLine("最大公约数为：" + gcd(m, n));
        Console.WriteLine("最小公倍数为：" + lcm(m, n));
    }
}
